﻿@*@model EM.OA.Portal.Models.RemindModels*@
@{
    //Layout = "~/Views/Shared/_LayoutContent.cshtml";
    //Layout = null;
}
<script>
    var objectID;
    //根据提醒类型显示内容
    function remindTypeClick(id) {
        var divID = "div" + id;// $(this).attr("id");
        $("div[id^='div']").css("display", "none");
        $("#remindType input:radio").each(function () {
            if ($(this).attr("checked"))
                $("#" + divID).css("display", "block");
        });
        $("#divInstant").css("display", "block");
        //设置单选按钮的状态
        var radioID = id;// $(this).attr("id");
        $("#remindType input:radio").each(function () {
            if ($(this).attr("id") == radioID)
                $(this).attr("checked", "checked");
            else
                $(this).removeAttr("checked");
        });
    }
    //根据重复类型显示内容
    function repeatTypeChange() {
        var divID = "div" + $('#repeatType').attr("value");
        $("div[id='divMulti'] > div[id]").css("display", "none");
        $("#" + divID).css("display", "block");
    }

    $(function () {
        try {
            remindInit();
        }
        catch (e) { }
        $("#Instant").attr("checked", "checked");
        //增加日下拉选择框
        var obj = $("#month");
        for (var i = 1; i <= 31; i++) {
            var option = new Option(i, i);
            $("#month").append(option);
        }
        //设置当前天
        var today = new Date();
        $("#month option").eq(today.getDate() - 1).attr('selected', 'true');
        //当前月－日
        var currMonth = today.getMonth() + 1;
        $("#monthDay").html(currMonth + "-" + today.getDate());
    })

</script>
<div>
    @*    <form id="fmRemind" method="post" style="font-size: 12px">*@
    <input type="hidden" name="objectID" id="objectID" />
    <div id="remindType">
        <input type="radio" name="RemindModels.Instant" id="Instant" checked="checked" onclick="remindTypeClick('Instant')" /><label for="Instant">即时提醒</label>
        <input type="radio" name="RemindModels.Single" id="Single" onclick="remindTypeClick('Single')" /><label for="Single">单次提醒</label>
        <input type="radio" name="RemindModels.Multi" id="Multi" onclick="remindTypeClick('Multi')" /><label for="Multi">重复提醒</label>
    </div>
    <div id="divSingle" style="display: none;">
        提醒时间：<input name="RemindModels.singleRemindTime" class="easyui-datetimebox" data-options="required:false,showSeconds:false" />
    </div>
    <div id="divMulti" style="display: none;">
        <div>
            重复频率:
            <select id="repeatType" name="RemindModels.repeatType" onchange="repeatTypeChange()">
                <option value="3" selected>每天</option>
                <option value="4">每周</option>
                <option value="5">每月</option>
                <option value="6">每年</option>
            </select>
        </div>
        <div id="div4" style="display: none">
            重复日期：<input type="checkbox" id="1" name="week1" /><label for="1">周一</label>
            <input type="checkbox" id="2" name="week2" /><label for="2">周二</label>
            <input type="checkbox" id="3" name="week3" /><label for="3">周三</label>
            <input type="checkbox" id="4" name="week4" /><label for="4">周四</label>
            <input type="checkbox" id="5" name="week5" /><label for="5">周五</label>
            <input type="checkbox" id="6" name="week6" /><label for="6">周六</label>
            <input type="checkbox" id="7" name="week7" /><label for="7">周日</label>
        </div>
        <div id="div5" style="display: none">
            提醒日期：
                <select id="month" name="month">
                </select>日
        </div>
        <div id="div6" style="display: none">
            提醒日期：<input name="monthDay" class="easyui-datebox" data-options="required:false" />
        </div>
        提醒时间：<input name="multiRemindTime" class="easyui-timespinner" data-options="required:false" />
        <br />
        开始日期：<input name="startDate" class="easyui-datebox" />
        <br />
        结束日期：<input name="endDate" class="easyui-datebox" />
    </div>
    <div id="divInstant">
        <input type="checkbox" id="RemindModels.Mail" name="RemindModels.Mail" /><label for="Mail">邮件提醒</label>&nbsp;
            <input type="checkbox" id="RemindModels.SMS" name="RemindModels.SMS" /><label for="SMS">短信提醒</label>&nbsp;
            <input type="checkbox" id="RemindModels.WebMessage" name="RemindModels.WebMessage" /><label for="WebMessage">短消息提醒</label>
    </div>
    @*    </form>*@
</div>
